Find Strike and Dip Given Three Points

Steven Dutch, Professor Emeritus, Natural and Applied Sciences,Universityof Wisconsin - Green Bay


Chapter 3 Points, Lines And Planes

Points, lines, and planes crop up in geology wheneverspatial relationships are concerned. This section is concernedmostly with providing formulas for reference. The formulas arewritten wherever practical in computer format, though manyformulas also lend themselves to matrix representation and theseformulas are also presented.

3-1 Points In A Plane

Distance between two points (X1,Y1) and (X2,Y2)

D = SQR((X2-X1)*(X2-X1) + (Y2-Y1)*(Y2-Y1))

Midpoint of the line joining (X1,Y1) and (X2,Y2)

X = (X2 + X1)/2 Y = (Y1 + Y2)/2

Point dividing (X1,Y1) and (X2,Y2) in the ratio R/S

X = (R*X2 + S*X1)/(R + S)
Y = (R*Y2 + S*Y1)/(R + S)
Point lies R/S of the way from (X1,Y1) to (X2,Y2)

Slope of the line joining (X1,Y1) and (X2,Y2)

M = (Y2 - Y1)/(X2 - X1)

Test for collinearity of three points (X1,Y1),(X2,Y2), and (X3,Y3)

          |X1  Y1  1|                |X2  Y2  1|  = 0                       |X3  Y3  1|

or, X2*Y3 - X3*Y2 + X3*Y1 - X1*Y3 + X1*Y2 - X2*Y1 = 0

Area of triangle bounded by three points (X1,Y1),(X2,Y2),(X3,Y3)

                     |X1  Y1  1|            A = (1/2) |X2  Y2  1|                            |X3  Y3  1|

or A = (X2*Y3 - X3*Y2 + X3*Y1 - X1*Y3 + X1*Y2 - X2*Y1)/2
Note that if the points are collinear, the area is zero, leading to the test for collinearity above.

If the sides of the triangle bounded by the three points are A,B, and C, the radius of the circle inscribed in the triangle (the incircle) is
R = AREA/((A + B + C)/2).

The circle that passes through the vertices of the triangle (thecircumcircle) has radius R = (A*B*C)/(4 * AREA)

There are three escribed circles, which touch the outside of oneedge and the extensions of the two other edges. Their radii are

where R1 is the radius of the circle that touches edge A and theextensions of edges B and C. The side with the minus sign is the side tangent to the circle.

3-2 Points In Three Dimensions

Distance between two points (X1,Y1,Z1) and (X2,Y2,Z2)

D = SQR((X2-X1)*(X2-X1) + (Y2-Y1)*(Y2-Y1) + (Z2-Z1)*(Z2-Z1))

Midpoint of the line joining (X1,Y1,Z1) and (X2,Y2,Z2)

X = (X2 + X1)/2 Y = (Y1 + Y2)/2 Z = (Z1 + Z2)/2

Point dividing (X1,Y1,Z1) and (X2,Y2,Z2) in the ratio R/S

X = (R*X2 + S*X1)/(R + S), Y = (R*Y2 + S*Y1)/(R + S), Z = (R*Z2 + S*Z1)/(R + S) Point lies R/S of the way from (X1,Y1,Z1) to (X2,Y2,Z2) Test for collinearity of three points (X1,Y1),(X2,Y2), and (X3,Y3): The ratios (X2 - X1) : (Y2 - Y1) : (Z2 - Z1) (X2 - X1) : (Y2 - Y1) : (Z2 - Z1) are identical

Area of triangle bounded by three points (X1,Y1,Z1),(X2,Y2,Z2) and (X3,Y3,Z3):

                                   1            _____________________________________________            |Y1  Z1  1| 2    |Z1  X1  1| 2    |X1  Y1  1| 2A = (1/2)   |Y2  Z2  1|    + |Z2  X2  1|    + |X2  Y2  1|            |Y3  Z3  1|      |Z3  X3  1|      |X3  Y3  1|
This formula, like many others we will encounter, is too complex to get on one program line. We can evaluate it using the following routine: 10 S = (Y2-Y1)*(Z3-Z1) - (Y3-Y1)*(Z2-Z1) 20 T = S*S 30 S = (Z2-Z1)*(X3-X1) - (Z3-Z1)*(X2-X1) 40 T = T + S*S 50 S = (X2-X1)*(Y3-Y1) - (X3-X1)*(Y2-Y1) 60 T = T + S*S 70 A = SQR(T)/2 Four points, (X1,Y1,Z1),(X2,Y2,Z2),(X3,Y3,Z3) and (X4,Y4,Z4) are coplanar if and only if: |X1 Y1 Z1 1| | | |X2 Y2 Z2 1| | | = 0 |X3 Y3 Z3 1| | | |X4 Y4 Z4 1| or, (X1 - X2) * ((Y3 - Y2)*(Z4 - Z2) - (Y4 - Y2)*(Z3 - Z2)) + (Y1 - Y2) * ((X4 - X2)*(Z3 - Z2) - (X3 - X2)*(Z4 - Z2)) + (Z1 - Z2) * ((X3 - X2)*(Y4 - Y2) - (X4 - X2)*(Y3 - Y2)) = 0 By comparison with the following formula, we can see that this test amounts to seeing whether or not the tetrahedron defined by the four points has zero volume. Volume of the tetrahedron bounded by four points (X1,Y1,Z1), (X2,Y2,Z2), (X3,Y3,Z3) and (X4,Y4,Z4)

 |X1 Y1 Z1 1| | | |X2 Y2 Z2 1| V = (1/6) | | |X3 Y3 Z3 1| | | |X4 Y4 Z4 1| or

V = (X1 - X2) * ((Y3 - Y2)*(Z4 - Z2)  -  (Y4 - Y2)*(Z3 - Z2))/6 + (Y1 - Y2) * ((X4 - X2)*(Z3 - Z2) - (X3 - X2)*(Z4 - Z2))/6 + (Z1 - Z2) * ((X3 - X2)*(Y4 - Y2) - (X4 - X2)*(Y3 - Y2))/6

3-3 Lines In The Plane

3-3a General Form: A*X + B*Y + C = 0

  • Slope: M = -A/b
  • Intercepts: X = -C/a Y = -C/b
  • Point closest to origin: X = A*C/SQR(A*A+B*B) Y = B*C/SQR(A*A+B*B)
  • Distance of line from origin D = C/SQR(A*A+B*B)
  • Distance from line to an arbitrary point X0,Y0: D = (A*X0 + B*Y0 + C) / SQR(A*A+B*B)
  • Closest point on the line to X0,Y0:

3-3b  Normal Form: X * Cos(U) + Y * Sin(U) = P

  • Slope: M = -TAN(U)
  • Intercepts: X = -P/cOS(U) Y = -P/SIN(U)
  • Point closest to origin: X = P * COS(U) Y = P * SIN(U)
  • Distance of line from origin D = P
  • Distance from line to an arbitrary point X0,Y0: D = (X0*COS(U) + Y0*SIN(U) - P)
  • Closest point on the line to X0,Y0:

3-3cSlope - Y-Intercept Form Y = M * X + B

  • Slope: M
  • Intercepts: X = -B/m Y = B
  • Point Closest to origin X = M/SQR(1 + M*M), Y = 1/SQR(1 + M*M)
  • Distance of line from origin D = B/SQR(1 + M*M)
  • Distance from line to an arbitrary point X0,Y0: D = (M*X0 - Y0 + B) / SQR(1 + M*M)
  • Closest point on the line to X0,Y0:

3-3d Intercept Form X/a + Y/b = 1

  • Slope: M = -B/a
  • Intercepts: X = A Y = B
  • Point closest to origin: X = B / SQR(A*A + B*B) Y = A / SQR(A*A + B*B)
  • Distance of line from origin D = A*B/SQR(A*A + B*B)
  • Distance from line to an arbitrary point X0,Y0: D = (A*B - A*X0 - B*Y0 ) / SQR(A*A+B*B)

3-3e Two-Point Form (Y-Y1)/(Y2-Y1) = (X-X1)/(X2-X1)

  • or, Y = X*(Y2-Y1)/(X2-X1) - X1*(Y2-Y1)/(X2-X1) + Y1
  • Slope: M = (Y2-Y1)/(X2-X1) Intercepts
  • 3-4 TWO LINES IN THE PLANE
  • Angle between two lines of slopes M1 and M2 A = ATN((M2 - M1)/(1 + M1*M2))
  • Lines are parallel if M1=M2, perpendicular if M1*M2 = -1

3-4a Intersection Of Two Lines In The Plane:

General Form: A1*X + B1*Y + C1 =0 and A2*X + B2*Y + C2 = 0

  • X = (B1*C2-C1*B2)/(A1*B2-A2*B1)
  • Y = (C1*A2-A1*C2)/(A1*B2-A2*B1)

Normal Form: X*COS(U1)+Y*SIN(U1)=P1 and X*COS(U2)+ Y*SIN(U2)=P2

  • X = (P1*SIN(U2)-P2*SIN(U1))/SIN(U2-U1)
  • Y = (P2*COS(U1)-P1*COS(U2))/SIN(U2-U1)

Slope-Intercept Form: Y = M1*X + B1 and Y = M2*X + B2

  • X = (B2-B1)/(M1-M2)
  • Y = (B1*M2-M1*B2)/(M1-M2)

Intercept Form: X/a1+Y/b1+Z/c1=1 and X/a2+Y/b2+Z/c2=1

  • X = A1*A2*(B1-B2)/(B1*A2-A1*B2)
  • Y = B1*B2*(A1-A2)/(B1*A2-A1*B2)

Angle between two lines

If the slopes are m1 and m2, the angle is given by tan a = (m1-m2)/(1+m1m2)

3-5 Three Lines In The Plane

Three lines given by the equations

  • A1*X + B1*Y + C1 =0,
  • A2*X + B2*Y + C2 = 0 and
  • A3*X + B3*Y + C3 = 0

meet at one point if and only if:

|A1  B1  C1|      |A2  B2  C2| = 0      |A3  B3  C3|

or C1*(A2*B3 - A3*B2) + C2*(A3*B1 - A1*B3) + C3*(A1*B2 - A2*B1) = 0

3-6 Lines In Three Dimensions

We can describe the orientation of a line in terms ofthree numbers, A, B, and C, called DIRECTION NUMBERS. A lineparallel to the given line and passing through the origin willmake angles U, V and W with the X, Y and Z axes respectively. Theangles are given by: COS(U) = A/SQR(A*A + B*B + C*C) COS(V) = B/SQR(A*A + B*B + C*C) COS(W) = C/SQR(A*A + B*B + C*C) The quantities COS(U), COS(V) and COS(W) are the DIRECTION COSINES of the line. They are obviously proportional to A, B, and C and are related by the formula COS(U)*COS(U) + COS(V)*COS(V) + COS(W)*COS(W) = 1

3-6a POINT-DIRECTION FORM, given point (X1,Y1,Z1) and directions A,B,C

Equation: (X - X1)/a = (Y - Y1)/b = (Z - Z1)/c

3-6b TWO-POINT FORM, given points (X1,Y1,Z1) and (X2,Y2,Z2)

Equation: (X-X1)/(X2-X1) = (Y-Y1)/(Y2-Y1) = (Z-Z1)/(Z2-Z1)

Obviously, if we know two points on a line, the differences between their X, Y and Z coordinates are direction numbers.

The plane which perpendicularly bisects line segment (X1,Y1,Z1), (X2,Y2,Z2) is: X*(X1-X2) + Y*(Y1-Y2) + Z*(Z1-Z2) = ((X1*X1-X2*X2) + (Y1*Y1-Y2*Y2) + (Z1*Z1-Z2*Z2))/2

3-6c PARAMETRIC FORM, given a point (X1,Y1,Z1) and directions A,B,C:

Equation: X = X1 + T*A;  Y = Y1 + T*B;  Z = Z1 + T*C
Probably the most useful form for generating points on an arbitrary line. Obviously, equal increments in T will result in equally-spaced points on the line.

3-6d GENERAL FORM, given the equations A1*X + B1*Y +C1*Z +D1 = 0 and A2*X + B2*Y + C2*Z + D2 = 0

The direction numbers of the line that satisfies both equations are
B1*C2-C1*B2,
C1*A2-A1*C2,
A1*B2-B1*A2.
This case is actually the case of two intersecting planes.

3-7 Two Or More Lines In Three Dimensions

3-7a Angle Between Two Lines

Given two lines with direction numbers (A1,B1,C1) and (A2,B2,C2), the angle between the two directions in space is given by:
COS(A) = (A1*A2+B1*B2+C1*C2)/(D1*D2)
SIN(A) = SQR((B1*C2-C1*B2)*(B1*C2-C1*B2) + (C1*A2-A1*C2)*(C1*A2-A1*C2) + (A1*B2-B1*A2)*(A1*B2-B1*A2))/(D1*D2)
Where D1 = SQR(A1*A1 + B1*B1 + C1*C1) and D2 = SQR(A2*A2 + B2*B2 + C2*C2).

From the above, we can also see that:
TAN(A) = SQR((B1*C2-C1*B2)*(B1*C2-C1*B2) + (C1*A2-A1*C2)*(C1*A2-A1*C2) + (A1*B2-B1*A2)*(A1*B2-B1*A2)) / (A1*A2+B1*B2+C1*C2)

This formula is independent of whether or not the directions are direction numbers or direction cosines.

If (A1,B1,C1) and (A2,B2,C2) are direction cosines, D1 and D2 both equal 1 and we have
COS(A) = (A1*A2+B1*B2+C1*C2)
SIN(A) = SQR((B1*C2-C1*B2)*(B1*C2-C1*B2) + (C1*A2-A1*C2)*(C1*A2-A1*C2) + (A1*B2-B1*A2)*(A1*B2-B1*A2))

3-7b Parallel And Perpendicular Lines

Given two lines with direction numbers (A1,B1,C1) and (A2,B2,C2):
The lines are parallel if A1:A2 = B1:B2 = C1:C2
The lines are perpendicular if A1*A2 + B1*B2 + C1*C2 =0

Both lines are perpendicular to the line whose direction numbers are: (B1*C2 - C1*B2), (C1*A2 - A1*C2), (A1*B2 - B1*A2)

3-7c Two Intersecting Lines

The two lines with point-direction equations
(X-X1)/a1 = (Y-Y1)/b1 = (Z-Z1)/c1 and
(X-X2)/a2 = (Y-Y2)/b2 = (Z-Z2)/c2 intersect if and only if:

 |X2-X1 Y2-Y1 Z2-Z1|  |  A1    B1    C1 | = 0  |  A2    B2    C2 |

or,(X2-X1)*(B1*C2-B2*C1) + (Y2-Y1)*(C1*A2-A1*C2) +(Z2-Z1)*(A1*B2-B1*A2) = 0

The lines intersect at: X = ((B1*A2*X1 -A1*B2*X2) + A1*A2*(Y2-Y1))/(B1*A2-A1*B2) or
X = ((C1*A2*X1 -A1*C2*X2) + A1*A2*(Z2-Z1))/(C1*A2-A1*C2)
Y = ((B1*A2*Y1 -A1*B2*Y2) + B1*B2*(X2-X1))/(B1*A2-A1*B2) or Y = ((C1*A2*Y1 -A1*C2*Y2) + B1*B2*(Z2-Z1))/(C1*A2-A1*C2)
Z = ((B1*A2*Z1 -A1*B2*Z2) + C1*C2*(Y2-Y1))/(B1*A2-A1*B2) or Z = ((C1*A2*Z1 -A1*C2*Z2) + C1*C2*(X2-X1))/(C1*A2-A1*C2) (MORE MOD NEEDED)

3-7d THREE COPLANAR LINES Three lines with directions (A1,B1,C1), (A2,B2,C2) and (A3,B3,C3) are parallel to a common plane if and only if :A1 B1 C1:

3-7 Planes

Just as we can use direction cosines to define a line, we can also use them to define a plane, since the line normal to a given plane has a unique orientation. In fact, this is one of the most useful ways to specify the orientation of a plane. The angles U, V, and W are the angles the X, Y, and Z axes make with the line normal to the plane and passing through the origin, or, in other words, the Direction Cosines of the line normal to the plane. These cosines are called Attitude Cosines when used to specify the orientation of the plane. Multiplying attitude cosines by a common multiple yields a set of numbers called Direction Numbers.

3-7a GENERAL FORM A*X + B*Y + C*Z + D = 0

 Intercepts: X = -D/a Y = -D/b Z = -D/c
Direction Numbers: A B C
Direction cosines: A/SQR(A*A + B*B + C*C) , and so on
Distance from origin:
Closest point to origin:

3-7b INTERCEPT FORM X/a + Y/b + C/Z = 1

Intercepts: X = A Y = B Z = C Direction Numbers Direction Cosines Distance from origin: Closest point to origin: Using the reciprocals of the intercepts is a very useful format for storing the orientations of planes, because it only takes three numbers to specify the position of a plane completely and there are no singularities when a plane happens to be parallel to a coordinate axis. The only limitation on this format is that a plane must not pass through the origin. This limitation can usually be avoided by a suitable choice of coordinate axes or, in some cases, by letting planes pass arbitrarily close to the origin but not exactly through it.

3-7c NORMAL FORM X*COS(U) + Y*COS(V) + Z*COS(W) = P

  • Intercepts: X = P/cOS(U) Y = P/cOS(V) Z = P/cOS(W)
  • Distance of plane from origin: D = P
  • Closest point to origin: X = P*COS(U) Y = P*COS(V) Z = P*COS(W)

For applications where the principal interest is in angular relationships (as in structural geology or crystallography), this is probably the best way to specify planes. In many such cases we can let the plane pass through the origin, in which case P=0.

3-7d Point - Normal Form

Given the point on the plane (X1,Y1,Z1) and the direction numbers of the plane: Equation: A*(X - X1) + B*(Y - Y1) + C*(Z -Z1) = 0

3-7e Plane Through One Point And Parallel To Two Lines

Given the point (X1,Y1,Z1) and two lines with directions A1,B1,C1 and A2,B2,C2:

|(X - X1)  (Y - Y1)  (Z - Z1)||   A1        B1        C1   |   = 0|   A2        B2        C2   | 

or,

X*((B1*C2)-(C1*B2)) + Y*((C1*A2)-(A1*C2) + Z*((A1*B2)-(B1*A2)) =
X1*((B1*C2)-(C1*B2)) + Y1*((C1*A2)-(A1*C2) + Z1*((A1*B2)-(B1*A2))

Two notes here. First of all, this form is geologically usefulbecause it is essentially the case of a plane whose strike anddip are known at a given point. The strike line is one of thegiven lines and the down-dip line the other. Second, this and thefollowing cases result in such complicated formulas that it ispointless to give additional formulas for intercepts and so on.Instead, the programmer should probably use a separate variablefor each coefficient and then treat the plane as one of thesimpler cases above.

3-7f Plane Through Two Points And Parallel To A Given Line

Given the two points (X1,Y1,Z1) AND (X2,Y2,Z2) and the line withdirections A ,B ,C:

|(X - X1)  (Y - Y1)  (Z - Z1) ||(X2 - X1) (Y2 - Y1) (Z2 - Z1)|  = 0|   A         B         C     | 

or, X*((Y2-Y1)*C - (Z2-Z1)*B) + Y*((Z2-Z1)*A - (X2-X1)*C) + Z*((X2-X1)*B - (Y2-Y1)*A) =
X1*((Y2-Y1)*C - (Z2-Z1)*B) + Y1*((Z2-Z1)*A - (X2-X1)*C) + Z1*((X2-X1)*B - (Y2-Y1)*A)

This case is exactly like the preceding case if we recall thatthe differences between coordinates of two points on a line aredirection numbers for that line. We merely substituted (X2-X1)for A1, A for A2, and so on.

3-7g Three-Point Form

Given the three points (X1,Y1,Z1), (X2,Y2,Z2) and (X3,Y3,Z3):

|X   Y   Z   1|            | X - X1   Y - Y1   Z - Z1||X1  Y1  Z1  1|    or      |X2 - X1  Y2 - Y1  Z2 - Z1| =  0|X2  Y2  Z2  1|            |X3 - X1  Y3 - Y1  Z3 - Z1||X3  Y3  Z3  1| 

or X * ((Y2 - Y1)*(Z3 - Z1) - (Y3 - Y1)*(Z2 - Z1))
+ Y * ((X3 - X1)*(Z2 - Z1) - (X2 - X1)*(Z3 - Z1))
+ Z * ((X2 - X1)*(Y3 - Y1) - (X3 - X1)*(Y2 - Y1)) =

   X1 * ((Y2 - Y1)*(Z3 - Z1) - (Y3 - Y1)*(Z2 - Z1))
+ Y1 * ((X3 - X1)*(Z2 - Z1) - (X2 - X1)*(Z3 - Z1))
+ Z1 * ((X2 - X1)*(Y3 - Y1) - (X3 - X1)*(Y2 - Y1))

 3-8 Two or More Planes

3-8a Intersection of Two Planes A1*X + B1*Y +C1*Z +D1 = 0 and A2*X + B2*Y + C2*Z + D2 = 0

 The direction numbers of the line that satisfies both equations are

  • B1*C2-C1*B2,
  •  C1*A2-A1*C2,
  • A1*B2-B1*A2 .

This line intersects the Z = 0 plane at:

  • X = (D1*B2 - D2*B1)/(A2*B1 - A1*B2) ,
  • Y = (D2*A1 - D1*A2)/(A2*B1 - A1*B2) ,
  • Z = 0

The equation of the line can therefore be written using the point-slope form or the parametric form.

3-8b Intersection of Three Planes

Three planes, given by equations A1*X + B1*Y + C1*Z +D1 =0, A2*X + B2*Y + C2*Z +D2 =0, and A3*X + B3*Y + C3*Z +D3 =0, meet at either a point, a common line, or not at all. Finding the solution amounts to solving three equations in three unknowns. Computationally, the easiest way to approach this problem is by determinants. You need to compute:

       |A1  B1  C1|            |D1  B1  C1|E0 =  |A2  B2  C2|       E1 = |D2  B2  C2|      |A3  B3  C3|            |D3  B3  C3|      |A1  D1  C1|            |A1  B1  D1|E2 =  |A2  D2  C2|       E3 = |A2  B2  D2|      |A3  D3  C3|            |A3  B3  D3| 

The full expressions for E0,E1,E2 and E3 are as follows:

E0 = A1*(B2*C3-B3*C2) + A2*(C1*B3-C3*B1) + A3*(B1*C2-B2*C1)
E1 = D1*(B2*C3-B3*C2) + D2*(C1*B3-C3*B1) + D3*(B1*C2-B2*C1)
E2 = A1*(D2*C3-D3*C2) + A2*(C1*D3-C3*D1) + A3*(D1*C2-D2*C1)
E3 = A1*(B2*D3-B3*D2) + A2*(D1*B3-D3*B1) + A3*(B1*D2-B2*D1)

The common solution of the three equations is given by: X = E1/e0 Y = E2/e0 Z = E3/e0

Note that
If E0 = 0 the solution is indeterminate.
If any two sets of direction numbers have identical ratios, say: A1 : B1 : C1 = A2 : B2 : C2 , then those two planes are parallel.
If this condition does not exist for any pair of planes but E0 is still zero, then all three planes meet in a common line.

In writing programs that involve the intersections of several planes, it is usually useful to compute E0 first. If it turns out to be zero there may be no need to perform the other calculations. This method, though well-known, can be astonishingly hard to find in a math text. One major text I know of has no listings at all under simultaneous equations or determinants. It is therefore useful to know the formal names of this method: Cramer's Rule or the Rule of Sarrus.